package com.gopay.common.trace.httpclient;

import com.gopay.common.trace.helper.LogAbstractHelper;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
import org.apache.http.HttpResponseInterceptor;
import org.apache.http.protocol.HttpContext;

import java.io.IOException;

/** httpclient 返回拦截器
 * @author ddh02
 * @HttpResponseInterceptor
 * @2017/5/12 15:58  www.gopay.com.cn Inc.All rights reserved.
 */

public class HttpResponseInterceptorImpl extends HttpInterceptorBase implements HttpResponseInterceptor{

    @Override
    public void process(HttpResponse httpResponse, HttpContext httpContext) throws HttpException, IOException {

        LogAbstractHelper helper = getHelper(httpContext);
        if (helper != null) {
            helper.afterT(httpResponse, httpContext);
        }
    }
}
